package com.qiaoba.module.generator.constant;

/**
 * 代码生成通用常量
 *
 * @author ailanyin
 * @date 2023-10-4 11:16:33
 */
public class GenConstants {

    /*====================================[数据库]=========================================*/

    /**
     * 数据库字符串类型
     */
    public static final String[] COLUMN_TYPE_STR = {"char", "varchar", "nvarchar", "varchar2"};

    /**
     * 数据库文本类型
     */
    public static final String[] COLUMN_TYPE_TEXT = {"tinytext", "text", "mediumtext", "longtext"};

    /**
     * 数据库时间类型
     */
    public static final String[] COLUMN_TYPE_TIME = {"datetime", "time", "date", "timestamp"};

    /**
     * 数据库数字类型
     */
    public static final String[] COLUMN_TYPE_NUMBER = {"tinyint", "smallint", "mediumint", "int", "number", "integer",
            "bit", "bigint", "float", "double", "decimal"};

    /**
     * 数据库类型
     */
    public static final String[] COLUMN_TYPE_INT = {"tinyint", "smallint", "mediumint", "int", "integer"};
    public static final String[] COLUMN_TYPE_BIGINT = {"bigint"};
    public static final String[] COLUMN_TYPE_FLOAT = {"float"};
    public static final String[] COLUMN_TYPE_DOUBLE = {"double", "number"};
    public static final String[] COLUMN_TYPE_BIGDECIMAL = {"decimal"};
    public static final String[] COLUMN_TYPE_BIT = {"bit"};

    /**
     * 页面不需要处理的字段
     */
    public static final String[] COLUMN_NAME_NOT_HANDLE = {"id", "create_user", "create_time", "del_flag", "update_user",
            "update_time", "tenant_id"};


    /**
     * Entity基类字段
     */
    public static final String[] BASE_ENTITY = {"createUser", "createTime", "updateUser", "updateTime", "remark", "tenantId"};

    /*====================================[前端控件]=========================================*/
    /**
     * 文本框
     */
    public static final String HTML_INPUT = "input";

    /**
     * 文本域
     */
    public static final String HTML_TEXTAREA = "textarea";

    /**
     * 下拉框
     */
    public static final String HTML_SELECT = "select";

    /**
     * 单选框
     */
    public static final String HTML_RADIO = "radio";

    /**
     * 复选框
     */
    public static final String HTML_CHECKBOX = "checkbox";

    /**
     * 日期控件
     */
    public static final String HTML_DATETIME = "datetime";

    /**
     * 图片上传控件
     */
    public static final String HTML_IMAGE_UPLOAD = "imageUpload";

    /**
     * 文件上传控件
     */
    public static final String HTML_FILE_UPLOAD = "fileUpload";

    /**
     * 富文本控件
     */
    public static final String HTML_EDITOR = "editor";

    /*====================================[后端类型]=========================================*/
    /**
     * 字符串类型
     */
    public static final String TYPE_STRING = "String";

    /**
     * 整型
     */
    public static final String TYPE_INTEGER = "Integer";

    /**
     * 长整型
     */
    public static final String TYPE_LONG = "Long";

    /**
     * 单精度浮点型
     */
    public static final String TYPE_FLOAT = "Float";

    /**
     * 双精度浮点型
     */
    public static final String TYPE_DOUBLE = "Double";

    /**
     * 高精度计算类型
     */
    public static final String TYPE_BIGDECIMAL = "BigDecimal";

    /**
     * 布尔
     */
    public static final String TYPE_BOOLEAN = "Boolean";

    /**
     * 时间类型
     */
    public static final String TYPE_DATE = "Date";

    /**
     * 模糊查询
     */
    public static final String QUERY_LIKE = "LIKE";

    /**
     * 相等查询
     */
    public static final String QUERY_EQ = "EQ";

    /**
     * 需要
     */
    public static final String REQUIRE = "1";

    /*====================================[特殊处理]=========================================*/

    /**
     * 需要处理成 模糊搜索 的字段
     */
    public static final String[] LIKE_COLUMN = {"name", "code", "phone"};

    /**
     * 需要处理成 精准搜索 的字段
     */
    public static final String[] EQ_COLUMN = {"status"};

    /**
     * 需要处理成 单选框 的字段
     */
    public static final String[] HTML_RADIO_COLUMN = {"status"};

    /**
     * 需要处理成 下拉框 的字段
     */
    public static final String[] HTML_SELECT_COLUMN = {"type", "sex", "gender"};

    /**
     * 需要处理成 图片上传控件 的字段
     */
    public static final String[] HTML_IMAGE_COLUMN = {"image", "pic"};

    /**
     * 需要处理成 文件上传控件 的字段
     */
    public static final String[] HTML_FILE_COLUMN = {"file"};

    /**
     * 需要处理成 富文本 的字段
     */
    public static final String[] HTML_EDITOR_COLUMN = {"content", "description"};

    /*====================================[下载类型]=========================================*/

    /**
     * 下载-全部
     */
    public static final String TEMPLATE_TYPE_ALL = "all";

    /**
     * 下载-后端
     */
    public static final String TEMPLATE_TYPE_JAVA = "java";

    /**
     * 下载-前端
     */
    public static final String TEMPLATE_TYPE_VUE = "vue";

    /**
     * 下载-SQL
     */
    public static final String TEMPLATE_TYPE_SQL = "sql";
}
